package de.preisrobot.entity;

import java.io.Serializable;

import javax.persistence.Embeddable;

@Embeddable
public class ArtikelDetailId implements Serializable
{

   public ArtikelDetailId()
   {

   }

   public ArtikelDetailId(long artikelid, long propertyid)
   {
      this.propertyid = propertyid;
      this.artikelid = artikelid;
   }

   private static final long serialVersionUID = 1L;

   private long artikelid;

   private long propertyid;

   public long getArtikelid()
   {
      return artikelid;
   }

   public void setArtikelid(long artikelid)
   {
      this.artikelid = artikelid;
   }

   public long getPropertyid()
   {
      return propertyid;
   }

   public void setPropertyid(long propertyid)
   {
      this.propertyid = propertyid;
   }
   
   public String toString()
   {
      return this.artikelid+" "+this.propertyid;
   }

   @Override
   public int hashCode()
   {
      final int prime = 31;
      int result = 1;
      result = prime * result + (int) (artikelid ^ (artikelid >>> 32));
      result = prime * result + (int) (propertyid ^ (propertyid >>> 32));
      return result;
   }

   @Override
   public boolean equals(Object obj)
   {
      if (this == obj)
         return true;
      if (obj == null)
         return false;
      if (getClass() != obj.getClass())
         return false;
      ArtikelDetailId other = (ArtikelDetailId) obj;
      if (artikelid != other.artikelid)
         return false;
      if (propertyid != other.propertyid)
         return false;
      return true;
   }
}
